<?php include load_template('_subnav.php') ?>
<h1>Form Leads</h1>

<p>Below is a list of people who have submitted forms.</p>
<p><?php

    echo form_tag('leads',array('method'=>'get'));
    echo hidden_field_tag('browse','1');
    echo '<b>Browse By</b>: Form: ' . select_tag('inbox_form_id',
                                        options_for_select($current_forms), 
                                        array('include_blank'=>true));
    echo ' Date: ' . select_date('date', array('use_month_names'=>true,'include_blank'=>true)); 
    echo submit_tag('Go');
    echo ' '.link_to('View All',array('controller'=>'admin/inbox' ,'action'=>'leads?view_all=1'));
    echo end_form_tag();
?></p>
<br />
<?php

    $report->set_action('view',url_for(array('controller'=>'admin/inbox' ,'action'=>'view_lead')));
    $report->set_action('csv',url_for(array('controller'=>'admin/inbox' ,'action'=>'download_leads')));
    $report->set_action('delete',url_for(array('controller'=>'admin/inbox' ,'action'=>'delete_lead')));
    $table = $report->Render(30);
    if ( $report->total_rows > 0 )
    {
        echo content_tag('p',link_to('Download All Leads',array('controller'=>'admin/inbox' ,'action'=>'download_leads')));
    }
    echo $table;
?>